package lec04.pm.gm.v2;

public class Line {
	public Line(Point p, Point q) {
		this.p = p;
		this.q = q;
	}

	protected Point p;

	public Point getP() {
		return p;
	}

	public void setP(Point p) {
		this.p = p;
	}

	public Point getQ() {
		return q;
	}

	public void setQ(Point q) {
		this.q = q;
	}

	protected Point q;

	@Override
	public boolean equals(Object obj) {
		if (this == obj)
			return true;
		if (obj instanceof Line) {
			Line that = (Line) obj;
			double d1 = this.p.getDistance(that);
			double d2 = this.q.getDistance(that);
			return d1 == 0 && d2 == 0;
		} 
		return false;
	}

}
